﻿using System;

namespace Lucene.Net.Store.S3 {

	public class Lock : Lucene.Net.Store.Lock {
		private readonly Directory s3Directory;
		private readonly String name;
		private Boolean locked = false;

		public Lock(String name, Directory s3Directory) {
			this.name = name;
			this.s3Directory = s3Directory;
		}

		public override Boolean IsLocked() {
			return locked;
		}

		public override Boolean Obtain() {
			this.locked = true;
			return this.locked;
		}

		public override void Release() {
			this.locked = false;
		}
	}
}